
'simple window with an infinite grid

Import maxgui.maxgui
Import maxgui.drivers
Import wdw.grid

Local w:TGadget = createwindow("example 1",0,0,400,400)
Local c:TGadget = createcanvas(0,0,400,400,w)
SetGadgetLayout(c, EDGE_ALIGNED, EDGE_ALIGNED, EDGE_ALIGNED, EDGE_ALIGNED)


Local g:TGrid = New TGrid
g.SetCanvas(c)
ActivateGadget(c)

Repeat
	WaitEvent()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			End
		Case EVENT_GADGETPAINT
			g.Render()
			g.RenderMouse()
			Flip
		Case EVENT_MOUSEMOVE
			g.OnMouseMove()

	End Select
Forever